"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . views import viewsIndex,viewsUsers,viewsCates,viewsGoods,viewsOrder

urlpatterns = [

    # 首页
    url(r'^$', viewsIndex.index,name = 'myadmin_index'),
    # 登录
    url(r'^login/$', viewsIndex.myadminlogin,name = 'myadmin_login'),
    # 验证码
    url(r'^verifycode/$', viewsIndex.verifycode,name = 'myadmin_verifycode'),
    # 后台退出
    url(r'^logout/$', viewsIndex.myadminlogout,name = 'myadmin_logout'),


    # ---------------------viewsUsers-------------------
    # 会员添加
    url(r'^user/add/$', viewsUsers.useradd,name = 'myadmin_user_add'),
    # 显示会员信息
    url(r'^user/index/$', viewsUsers.userindex,name = 'myadmin_user_index'),
    # 删除会员
    url(r'^user/del/(?P<uid>[0-9]+)/$', viewsUsers.userdel,name = 'myadmin_user_del'),
    # 修改会员信息
    url(r'^user/edit/(?P<uid>[0-9]+)/$', viewsUsers.useredit,name = 'myadmin_user_edit'),
    

    # ---------------------viewsCates-------------------

    # 商品分类添加
    url(r'^cates/add/$', viewsCates.catesadd,name='myadmin_cates_add'),
    # 商品分类的显示
    url(r'^cates/index/$', viewsCates.catesindex,name='myadmin_cates_index'),
    # 商品分类的删除
    url(r'^cates/del/$', viewsCates.catesdel,name='myadmin_cates_del'),
    # 商品分类的修改
    url(r'^cates/edit/$', viewsCates.catesedit,name='myadmin_cates_edit'),



    # ---------------------viewsGoods-------------------

    # 商品添加
    url(r'^goods/add/$', viewsGoods.goodsadd,name='myadmin_goods_add'),
    # 执行商品添加
    url(r'^goods/insert/$', viewsGoods.goodsinsert,name='myadmin_goods_insert'),
    # 商品列表
    url(r'^goods/index/$', viewsGoods.goodsindex,name='myadmin_goods_index'),
    # 商品删除
    url(r'^goods/del/(?P<uid>[0-9]+)/$', viewsGoods.goodsdel,name='myadmin_goods_del'),
    # 商品的修改
    url(r'^goods/edit/(?P<uid>[0-9]+)/$', viewsGoods.goodsedit,name='myadmin_goods_edit'),
    
     
    # ---------------------viewsGoods-------------------
    # 订单显示
    url(r'^order/index/$', viewsOrder.orderindex,name='myadmin_order_index'),
    # 订单状态修改
    url(r'^order/edit/$', viewsOrder.orderedit,name='myadmin_order_edit'),
    # 查看订单详情
    url(r'^order/info/$', viewsOrder.orderinfo,name='myadmin_order_info'),

]   
